/**
 * Copyright (c) 2014, 2017, Oracle and/or its affiliates.
 * The Universal Permissive License (UPL), Version 1.0
 */
"use strict";
define(["ojs/ojcore","jquery","ojs/ojcomponentcore","ojs/ojdvt-base","ojs/internal-deps/dvt/DvtChart"],function(a,g,b,c,d){a.Ra("oj.ojSparkChart",g.oj.dvtBaseComponent,{widgetEventPrefix:"oj",options:{},Dg:function(a,b,c){this._focusable({element:this.element,applyHighlight:!0});return d.SparkChart.newInstance(a,b,c)},Jf:function(){var a=this._super();a.push("oj-sparkchart");return a},Ti:function(){var a=this.options.translations,b=this._super();b["DvtUtilBundle.CHART"]=a.componentName;return b},
Sh:function(){this.element.attr("title")?(this.options.shortDesc=this.element.attr("title"),this.element.data(this.element,"title",this.element.attr("title")),this.element.removeAttr("title")):this.element.data("title")&&(this.options.shortDesc=this.element.data("title"));this._super()},getDataItem:function(b){var c=this.xa.getAutomation();return new a.Lh(c.getDataItem(b))},Ik:function(){return{root:["items"]}}});a.Lh=function(a){this.i=a};o_("SparkChartDataItem",a.Lh,a);a.Lh.prototype.cga=function(){return this.i?
this.i.borderColor:null};a.b.g("SparkChartDataItem.prototype.getBorderColor",{cga:a.Lh.prototype.cga});a.Lh.prototype.iga=function(){return this.i?this.i.color:null};a.b.g("SparkChartDataItem.prototype.getColor",{iga:a.Lh.prototype.iga});a.Lh.prototype.getDate=function(){return this.i?this.i.date:null};a.b.g("SparkChartDataItem.prototype.getDate",{getDate:a.Lh.prototype.getDate});a.Lh.prototype.getFloatValue=function(){return this.SY()};a.b.g("SparkChartDataItem.prototype.getFloatValue",{getFloatValue:a.Lh.prototype.getFloatValue});
a.Lh.prototype.SY=function(){return this.i?this.i.low:null};a.b.g("SparkChartDataItem.prototype.getLow",{SY:a.Lh.prototype.SY});a.Lh.prototype.xga=function(){return this.i?this.i.high:null};a.b.g("SparkChartDataItem.prototype.getHigh",{xga:a.Lh.prototype.xga});a.Lh.prototype.ie=function(){return this.i?this.i.value:null};a.b.g("SparkChartDataItem.prototype.getValue",{ie:a.Lh.prototype.ie});a.Ra("oj.ojChart",g.oj.dvtBaseComponent,{widgetEventPrefix:"oj",options:{categoryFilter:null,categoryHighlight:null,
optionChange:null,selectInput:null,viewportChange:null,viewportChangeInput:null,drill:null},Dg:function(a,b,c){return d.Chart.newInstance(a,b,c)},Hk:function(a){var b=a.subId;"oj-chart-item"==b?b="dataItem["+a.seriesIndex+"]["+a.itemIndex+"]":"oj-chart-group"==b?b="group"+this.Pu(a.indexPath):"oj-chart-series"==b?b="series["+a.index+"]":"oj-chart-axis-title"==b?b=a.axis+":title":"oj-chart-reference-object"==b?b=a.axis+":referenceObject["+a.index+"]":"oj-legend-section"==b?b="legend:section"+this.Pu(a.indexPath):
"oj-legend-item"==b?(b="legend:section"+this.Pu(a.sectionIndexPath),b+=":item["+a.itemIndex+"]"):"oj-chart-tooltip"==b&&(b="tooltip");return b},Oh:function(a){var b={};if(0==a.indexOf("dataItem")){var c=this.Qm(a);b.subId="oj-chart-item";b.seriesIndex=c[0];b.itemIndex=c[1]}else if(0==a.indexOf("group"))b.subId="oj-chart-group",b.indexPath=this.Qm(a);else if(0==a.indexOf("series"))b.subId="oj-chart-series",b.index=this.Jk(a);else if(0<a.indexOf("Axis:title"))b.subId="oj-chart-axis-title",b.axis=a.substring(0,
a.indexOf(":"));else if(0<a.indexOf("Axis:referenceObject"))b.subId="oj-chart-reference-object",b.axis=a.substring(0,a.indexOf(":")),b.index=this.Jk(a);else if(0==a.indexOf("legend"))if(0<a.indexOf(":item")){var d=a.indexOf(":item"),c=a.substring(0,d);a=a.substring(d);b.subId="oj-legend-item";b.sectionIndexPath=this.Qm(c);b.itemIndex=this.Jk(a)}else 0==a.indexOf("section")&&(b.subId="oj-legend-section",b.indexPath=this.Qm(a));else"tooltip"==a&&(b.subId="oj-chart-tooltip");return b},KH:function(){this._super();
this.options.styleDefaults||(this.options.styleDefaults={});if(!this.options.styleDefaults.colors){var b=new a.ug;this.options.styleDefaults.colors=b.Kn()}},Jf:function(){var a=this._super();a.push("oj-chart");return a},Ej:function(){var a=this._super();a["oj-chart-data-label"]={path:"styleDefaults/dataLabelStyle",property:"CSS_TEXT_PROPERTIES"};a["oj-chart-stack-label"]={path:"styleDefaults/stackLabelStyle",property:"CSS_TEXT_PROPERTIES"};a["oj-chart-footnote"]={path:"footnote/style",property:"CSS_TEXT_PROPERTIES"};
a["oj-chart-pie-center-label"]={path:"pieCenter/labelStyle",property:"CSS_TEXT_PROPERTIES"};a["oj-chart-slice-label"]={path:"styleDefaults/sliceLabelStyle",property:"CSS_TEXT_PROPERTIES"};a["oj-chart-subtitle"]={path:"subtitle/style",property:"CSS_TEXT_PROPERTIES"};a["oj-chart-stock-falling"]={path:"styleDefaults/stockFallingColor",property:"background-color"};a["oj-chart-stock-range"]={path:"styleDefaults/stockRangeColor",property:"background-color"};a["oj-chart-stock-rising"]={path:"styleDefaults/stockRisingColor",
property:"background-color"};a["oj-chart-tooltip-label"]={path:"styleDefaults/tooltipLabelStyle",property:"CSS_TEXT_PROPERTIES"};a["oj-chart-title"]={path:"title/style",property:"CSS_TEXT_PROPERTIES"};a["oj-chart-xaxis-tick-label"]={path:"xAxis/tickLabel/style",property:"CSS_TEXT_PROPERTIES"};a["oj-chart-xaxis-title"]={path:"xAxis/titleStyle",property:"CSS_TEXT_PROPERTIES"};a["oj-chart-yaxis-tick-label"]={path:"yAxis/tickLabel/style",property:"CSS_TEXT_PROPERTIES"};a["oj-chart-yaxis-title"]={path:"yAxis/titleStyle",
property:"CSS_TEXT_PROPERTIES"};a["oj-chart-y2axis-tick-label"]={path:"y2Axis/tickLabel/style",property:"CSS_TEXT_PROPERTIES"};a["oj-chart-y2axis-title"]={path:"y2Axis/titleStyle",property:"CSS_TEXT_PROPERTIES"};a["oj-legend"]={path:"legend/textStyle",property:"CSS_TEXT_PROPERTIES"};a["oj-legend-title"]={path:"legend/titleStyle",property:"CSS_TEXT_PROPERTIES"};return a},Fj:function(){return"categoryFilter categoryHighlight drill optionChange selectInput viewportChange viewportChangeInput".split(" ")},
Ti:function(){var a=this.options.translations,b=this._super();b["DvtChartBundle.DEFAULT_GROUP_NAME"]=a.labelDefaultGroupName;b["DvtChartBundle.LABEL_SERIES"]=a.labelSeries;b["DvtChartBundle.LABEL_GROUP"]=a.labelGroup;b["DvtChartBundle.LABEL_VALUE"]=a.labelValue;b["DvtChartBundle.LABEL_TARGET_VALUE"]=a.labelTargetValue;b["DvtChartBundle.LABEL_X"]=a.labelX;b["DvtChartBundle.LABEL_Y"]=a.labelY;b["DvtChartBundle.LABEL_Z"]=a.labelZ;b["DvtChartBundle.LABEL_PERCENTAGE"]=a.labelPercentage;b["DvtChartBundle.LABEL_LOW"]=
a.labelLow;b["DvtChartBundle.LABEL_HIGH"]=a.labelHigh;b["DvtChartBundle.LABEL_OPEN"]=a.labelOpen;b["DvtChartBundle.LABEL_CLOSE"]=a.labelClose;b["DvtChartBundle.LABEL_VOLUME"]=a.labelVolume;b["DvtChartBundle.LABEL_Q1"]=a.labelQ1;b["DvtChartBundle.LABEL_Q2"]=a.labelQ2;b["DvtChartBundle.LABEL_Q3"]=a.labelQ3;b["DvtChartBundle.LABEL_MIN"]=a.labelMin;b["DvtChartBundle.LABEL_MAX"]=a.labelMax;b["DvtChartBundle.LABEL_OTHER"]=a.labelOther;b["DvtChartBundle.PAN"]=a.tooltipPan;b["DvtChartBundle.MARQUEE_SELECT"]=
a.tooltipSelect;b["DvtChartBundle.MARQUEE_ZOOM"]=a.tooltipZoom;b["DvtUtilBundle.CHART"]=a.componentName;return b},El:function(a){var b=a.type;if("selection"===b){var c=a.selection;if(c){for(var b=[],d=[],g=0;g<c.length;g++){var m={data:c[g].data,seriesData:c[g].seriesData,groupData:c[g].groupData};b.push({id:c[g].id,series:c[g].series,group:c[g].group});d.push(m)}c={endGroup:a.endGroup,startGroup:a.startGroup,xMax:a.xMax,xMin:a.xMin,yMax:a.yMax,yMin:a.yMin,y2Max:a.y2Max,y2Min:a.y2Min,component:a.component,
selectionData:d};a.complete?this.fe("selection",b,c):(c.items=b,this._trigger("selectInput",null,c))}}else"categoryHide"===b||"categoryShow"===b?(this._trigger("categoryFilter",null,{category:a.category,type:"categoryHide"===b?"out":"in"}),this.fe("hiddenCategories",a.hiddenCategories)):"categoryHighlight"===b?(this._trigger("categoryHighlight",null,{categories:a.categories,type:a.categories&&0<a.categories.length?"on":"off"}),this.fe("highlightedCategories",a.categories)):"viewportChange"===b?(b=
{endGroup:a.endGroup,startGroup:a.startGroup,xMax:a.xMax,xMin:a.xMin,yMax:a.yMax,yMin:a.yMin},a.complete&&(this.options.xAxis||(this.options.xAxis={}),this.options.yAxis||(this.options.yAxis={}),this.options.xAxis.viewportStartGroup=null,this.options.xAxis.viewportEndGroup=null,null!=a.xMin&&null!=a.xMax&&(this.options.xAxis.viewportMin=a.xMin,this.options.xAxis.viewportMax=a.xMax),null!=a.yMin&&null!=a.yMax&&(this.options.yAxis.viewportMin=a.yMin,this.options.yAxis.viewportMax=a.yMax)),this._trigger(a.complete?
"viewportChange":"viewportChangeInput",null,b)):"drill"===b?this._trigger("drill",null,{id:a.id,series:a.series,group:a.group,data:a.data,seriesData:a.seriesData,groupData:a.groupData,component:a.component}):this._super(a)},Tm:function(){null==this.options._resources&&(this.options._resources={});var b=this.options._resources;b.overviewGrippy=a.fa.gb("resources/internal-deps/dvt/chart/drag_horizontal.png");b.panCursorDown=a.fa.gb("resources/internal-deps/dvt/chart/hand-closed.cur");b.panCursorUp=
a.fa.gb("resources/internal-deps/dvt/chart/hand-open.cur");b.panUp="oj-chart-pan-icon";b.panUpHover="oj-chart-pan-icon oj-hover";b.panDown="oj-chart-pan-icon oj-active";b.panDownHover="oj-chart-pan-icon oj-hover oj-active";b.selectUp="oj-chart-select-icon";b.selectUpHover="oj-chart-select-icon oj-hover";b.selectDown="oj-chart-select-icon oj-active";b.selectDownHover="oj-chart-select-icon oj-hover oj-active";b.zoomUp="oj-chart-zoom-icon";b.zoomUpHover="oj-chart-zoom-icon oj-hover";b.zoomDown="oj-chart-zoom-icon oj-active";
b.zoomDownHover="oj-chart-zoom-icon oj-hover oj-active"},getTitle:function(){return this.xa.getAutomation().getTitle()},getGroup:function(a){return this.xa.getAutomation().getGroup(a)},getSeries:function(a){return this.xa.getAutomation().getSeries(a)},getGroupCount:function(){return this.xa.getAutomation().getGroupCount()},getSeriesCount:function(){return this.xa.getAutomation().getSeriesCount()},getDataItem:function(a,b){var c=this.xa.getAutomation().getDataItem(a,b);this.Ri(c);return c},getLegend:function(){var a=
this.xa.getAutomation().getLegend();this.Ri(a);return a},getPlotArea:function(){var a=this.xa.getAutomation().getPlotArea();this.Ri(a);return a},getXAxis:function(){var a=this.xa.getAutomation().getXAxis();this.Ri(a);return a},getYAxis:function(){var a=this.xa.getAutomation().getYAxis();this.Ri(a);return a},getY2Axis:function(){var a=this.xa.getAutomation().getY2Axis();this.Ri(a);return a},getValuesAt:function(a,b){return this.xa.getValuesAt(a,b)},getContextByNode:function(a){return(a=this.getSubIdByNode(a))&&
"oj-chart-tooltip"!==a.subId?a:null},Ik:function(){return{root:["groups","series"]}}});a.Components.Xa("ojChart","dvtBaseComponent",{properties:{animationOnDataChange:{type:"string"},animationOnDisplay:{type:"string"},coordinateSystem:{type:"string"},dataCursor:{type:"string"},dataCursorBehavior:{type:"string"},dataCursorPosition:{type:"object"},dataLabel:{},dnd:{type:"object"},dragMode:{type:"string"},drilling:{type:"string"},footnote:{type:"object"},groups:{type:"Array\x3cobject\x3e|Array\x3cstring\x3e"},
hiddenCategories:{type:"Array\x3cstring\x3e"},hideAndShowBehavior:{type:"string"},highlightedCategories:{type:"Array\x3cstring\x3e"},highlightMatch:{type:"string"},hoverBehavior:{type:"string"},initialZooming:{type:"string"},legend:{type:"object"},orientation:{type:"string"},otherThreshold:{type:"number"},overview:{type:"object"},pieCenter:{type:"object"},pieCenterLabel:{type:"object"},plotArea:{type:"object"},polarGridShape:{type:"string"},selection:{type:"Array\x3cstring\x3e|Array\x3cobject\x3e"},
selectionMode:{type:"string"},series:{type:"Array\x3cobject\x3e"},sorting:{type:"string"},splitDualY:{type:"string"},splitterPosition:{type:"number"},stack:{type:"string"},stackLabel:{type:"string"},styleDefaults:{type:"object"},subtitle:{type:"object"},timeAxisType:{type:"string"},title:{type:"object"},tooltip:{type:"object"},touchResponse:{type:"string"},type:{type:"string"},valueFormats:{type:"Array\x3cobject\x3e"},xAxis:{type:"object"},y2Axis:{type:"object"},yAxis:{type:"object"},zoomAndScroll:{type:"string"},
zoomDirection:{type:"string"}},methods:{getContextByNode:{},getDataItem:{},getGroup:{},getGroupCount:{},getLegend:{},getPlotArea:{},getSeries:{},getSeriesCount:{},getTitle:{},getValuesAt:{},getXAxis:{},getY2Axis:{},getYAxis:{}},extension:{_widgetName:"ojChart"}});a.Components.register("oj-chart",a.Components.getMetadata("ojChart"));a.Components.Xa("ojSparkChart","dvtBaseComponent",{properties:{animationDuration:{type:"number"},animationOnDataChange:{type:"string"},animationOnDisplay:{type:"string"},
areaClassName:{type:"string"},areaColor:{type:"string"},areaStyle:{type:"object"},barGapRatio:{type:"number"},baselineScaling:{type:"string"},className:{type:"string"},color:{type:"string"},firstColor:{type:"string"},highColor:{type:"string"},items:{type:"Array\x3cobject\x3e|Array\x3cnumber\x3e"},lastColor:{type:"string"},lineStyle:{type:"string"},lineType:{type:"string"},lineWidth:{type:"number"},lowColor:{type:"string"},markerShape:{type:"string"},markerSize:{type:"number"},referenceObjects:{type:"Array\x3cobject\x3e"},
style:{type:"object"},tooltip:{type:"object"},type:{type:"string"},visualEffects:{type:"string"}},methods:{getDataItem:{}},extension:{_widgetName:"ojSparkChart"}});a.Components.register("oj-spark-chart",a.Components.getMetadata("ojSparkChart"))});